package com.aptech.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.aptech.dao.EmailOperateDao;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class EmailBlocker  extends AbstractInterceptor{
/**
 * 用于查询收件人信息的拦截类，将收件人信息塞入到request里面
 */
	
	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		EmailOperateDao emaildao=new EmailOperateDao();
		List l=emaildao.selectEmail();
		HttpServletRequest request =ServletActionContext.getRequest();
		request.setAttribute("username", l);
		return arg0.invoke();
	}

}
